package com.example.student1.service.impl;

import com.example.student1.dao.Teacher_LoginRepository;
import com.example.student1.domain.Student_Login;
import com.example.student1.domain.Teacher_Login;
import com.example.student1.service.Teacher_LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

@Service
@Transactional
public class Teacher_LoginImpService implements Teacher_LoginService {
    @Autowired
    Teacher_LoginRepository teacher_loginRepository;

    /*查询所有学生*/

    public List<Teacher_Login> findAll() {

        return teacher_loginRepository.findAll();
    }

    public List<Teacher_Login> findByNameAndPassword(String name, String password){
        return teacher_loginRepository.findByNameAndPassword(name,password);
    }

    public Teacher_Login insert(Teacher_Login teacher_login) {
        return teacher_loginRepository.save(teacher_login);
    }
}

